<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        span {
            display: block;
            width: 20px;
            height: 20px;
        }
    </style>
</head>

<body>
    <!-- ## 3.倒计时 -->
    <span id="show"></span>
    <button id="btn">开始倒计时</button>
    <script src="js/utils.js"></script>
    <script>
        var time = 11;
        function daojishi(time) {
            btn.onclick = function () {
                var times = setInterval(function () {
                    time--
                    show.innerHTML = time
                    if (time === 0) {
                        clearInterval(times);
                    }
                }, 1000)
            }
        }
        daojishi(time);
    </script>
</body>

</html>